/**
 * 
 */
package com.sx.feesunit.biz.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import com.sx.feesunit.biz.IAreaBiz;
import com.sx.feesunit.dao.IAreaDao;
import com.sx.feesunit.entity.AreaEntity;
import com.sx.feesunit.exception.SXException;

/**
 * @author Administrator
 *
 */
public class AreaBiz implements IAreaBiz {
	private IAreaDao iareadao;
	private Log log = LogFactory.getLog(this.getClass());
	
	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#findTop10AreaUsers(com.sx.feesunit.entity.AreaEntity)
	 */
	public List<AreaEntity> findTop10AreaUsers(AreaEntity area)
			throws Exception {
		try {
			return iareadao.findTop10AreaUsers(area);
		} catch (Exception e) {
			log.error("查询小区报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#addAreaInfo(com.sx.feesunit.entity.AreaEntity)
	 */
	public Integer addAreaInfo(AreaEntity area) throws SXException {
		// TODO Auto-generated method stub
		try {
			return iareadao.addAreaInfo(area);
		} catch (Exception e) {
			log.error("新增小区报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#deleteAreaInfo(com.sx.feesunit.entity.AreaEntity)
	 */
	public boolean deleteAreaInfo(AreaEntity area) throws SXException {
		// TODO Auto-generated method stub
		try {
			return iareadao.deleteAreaInfo(area);
		} catch (Exception e) {
			log.error("删除小区报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#findAreaInfo(com.sx.feesunit.entity.AreaEntity)
	 */
	public List<AreaEntity> findAreaInfo(AreaEntity area) throws SXException {
		// TODO Auto-generated method stub
		try {
			return iareadao.findAreaInfo(area);
		} catch (Exception e) {
			log.error("查询小区报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#findAreaInfoByAndCondiction(com.sx.feesunit.entity.AreaEntity)
	 */
	public List<AreaEntity> findAreaInfoByAndCondiction(AreaEntity area)
			throws SXException {
		try {
			return iareadao.findAreaInfoByAndCondiction(area);
		} catch (Exception e) {
			log.error("查询小区And条件报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#findAreaInfoByOrCondiction(com.sx.feesunit.entity.AreaEntity)
	 */
	public List<AreaEntity> findAreaInfoByOrCondiction(AreaEntity area)
			throws SXException {
		// TODO Auto-generated method stub
		try {
			return iareadao.findAreaInfoByOrCondiction(area);
		} catch (Exception e) {
			log.error("查询小区Or条件报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/* (non-Javadoc)
	 * @see com.sx.feesunit.biz.IAreaBiz#updateAreaInfo(com.sx.feesunit.entity.AreaEntity)
	 */
	public boolean updateAreaInfo(AreaEntity area) throws SXException {
		try {
			return iareadao.updateAreaInfo(area);
		} catch (Exception e) {
			log.error("修改小区报错",e);
			throw new SXException(e);
			// TODO: handle exceptio
		}
	}

	/**
	 * @return the iareadao
	 */
	public IAreaDao getIareadao() {
		return iareadao;
	}

	/**
	 * @param iareadao the iareadao to set
	 */
	public void setIareadao(IAreaDao iareadao) {
		this.iareadao = iareadao;
	}
	
}
